import { defHttp } from "@/utils/http";

// ERP 产品库存 VO
export interface StockVO {
	// 编号
	id: number;
	// 产品编号
	drugId: string;
	// 仓库编号
	whsId: string;
	// 库存数量
	count: number;
}

// ERP 产品库存 API
export const StockApi = {
	// 查询产品库存分页
	getStockPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/inventory/page`, params });
	},

	// 查询产品库存详情
	getStock: async (id: number) => {
		return await defHttp.get({ url: `/whs/inventory/get?id=` + id });
	},

	// 查询产品库存详情
	getStock2: async (productId: string, whsId: string) => {
		return await defHttp.get({ url: `/whs/inventory/get`, params: { productId, whsId } });
	},

	// 获得产品库存数量
	getStockCount: async (productId: string) => {
		return await defHttp.get({ url: `/whs/inventory/get-count`, params: { productId } });
	},

	// 导出产品库存 Excel
	exportStock: async (params: any) => {
		return await defHttp.download({ url: `/whs/inventory/export-excel`, params });
	}
};
